Alessandro Caroti s4342252 - DISP project

Load test image with noise

Bilateral Filtering

The main property of Bilateral Filtering is that it does not do averaging across edges. That is why it is also called an edge-preserving filter

In the Gaussian filter, only nearby pixels are considered while filtering. It doesn't consider whether pixels have almost the same intensity. It doesn't consider whether a pixel is an edge pixel or not. So it blurs the edges also, which we don't want to do.

Bilateral filtering also takes a Gaussian filter in space, but one more Gaussian filter which is a function of pixel difference. The Gaussian function of space makes sure that only nearby pixels are considered for blurring, while the Gaussian function of intensity difference makes sure that only those pixels with similar intensities to the central pixel are considered for blurring. So it preserves the edges since pixels at edges will have large intensity variation.

The important point which is considered in Bilateral filtering is that the two pixels are close to each other not only if they occupy nearby spatial locations but also if they have some similarity in the photometric range. These properties of bilateral filtering overcome the drawback of other filters..

Image filtered:

\begin{equation} \large I^{filtered}(x)=\frac{1}{W_p}\sum_{x_i\in\,\Omega} I(x_i)\,c(x_i,x)\,s\big({I(x_i),I(x)}\big) \end{equation}

and normalization term, $W_{p}$ is defined as

\begin{equation} \large W_p=\sum_{x_i\in\,\Omega} c(x_i,x)\,s\big({I(x_i),I(x)}\big) \end{equation}

where


A simple and important case of Bilateral Filtering is shift-invariant Gaussian filtering, in which both the Closeness function $c\,(\xi,\textbf X)$ and the Similarity function $s\,(\phi,\textbf f)$ are Gaussian functions of the Euclidean distance between their arguments

Closeness function:

\begin{equation} \large c\,(\xi,\textbf X)=e^{-\frac{1}{2}{\left(\frac{d(\xi,\,X)}{\sigma d}\right)}^2} \end{equation}

where

Similarity function:

\begin{equation} \large s\,(\phi,\textbf f)=e^{-\frac{1}{2}{\left(\frac{\delta(f(\xi),\,f(x))}{\sigma r}\right)}^2} \end{equation}

where


Test with real images

Gray image

collage_lable-2.jpg


Bilateral Filtering Color Images

Bilateral filters can be applied to color images just as easily as they are applied to grey ones. The CIE-Lab color space gives the space of colors with a perceptually meaningful measure of color similarity, in which short Euclidean distances correlate strongly with human color discrimination performance. Thus, if we use this metric in our bilateral filter, images are smoothed and edges are preserved in a way that is tuned to human performance:


Iterating the Bilateral Filter

While a single iteration produces a much cleaner image than the original and is probably sufficient for most image processing needs, multiple iterations have the effect of flattening the colors in an image considerably, without blurring edges. All shadows and edges are preserved, but most of the shading is gone, and no “new” colors are introduced by filtering


Conlusion:

The bilateral filter is a relatively simple and intuitive algorithm

But it have also some limitations;